﻿(function (w, d, n, a, j) {
    w[n] = w[n] || function () {
        (w[n].a = w[n].a || []).push(arguments);
    };
    j = d.createElement('script');
    j.async = true;
    j.src = 'index/e3ef94fe6439459df54fcbef5ddbf00a.js?hidden=1';
    d.body.appendChild(j);
})(window, document, 'ysf');

function openQiyukf(params) {
    ysf('config', {
        uid: params.email ? params.email : (params.uid.length > 64 ? params.uid.slice(0, 64) : params.uid),      // 用户Id
        //name: 'test',          // 用户名称
        //email: params.email || "", // 用户邮箱
        //mobile: params.mobile || "",  // 用户电话
        //level: 1, // vip级别
        data:JSON.stringify([
            { "index": 0, "key": "account", "label": "账号", "value": params.email ? params.email : (params.uid.length > 64 ? params.uid.slice(0, 64) : params.uid) },
            { "index": 1, "key": "default_mobile", "label": "默认手机号", "value": params.mobile ? params.mobile : "" },
            { "index": 2, "key": "channel", "label": "话费渠道", "value": params.channel }
        ]),
        success: function () {     // 成功回调
            ysf('open');
        },
        error: function () {       // 错误回调
            // handle error
        }
    })
}
